/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TimeRecording.business;

import java.util.ArrayList;

/**
 *
 * @author david
 */
public class IntegerTimeRangeArrayList extends ArrayList<IntegerTimeRange> {

    public IntegerTimeRangeArrayList crop (IntegerTimeRange crop) {

        IntegerTimeRangeArrayList croppedList = new IntegerTimeRangeArrayList();
        for (IntegerTimeRange timeRange : this) {
            IntegerTimeRange candidate = timeRange.clone();
            candidate.crop(crop);
            if (!candidate.isEmpty()) {
                croppedList.add(candidate);
            }
        }

        return croppedList;
    }

    public void normalise(int offset) {
        for (IntegerTimeRange timeRange : this) {
            timeRange.normalise(offset);
        }
    }

    @Override
    public String toString() {
        return "";
    }
}
